﻿using System.ComponentModel;
using System.Drawing.Design;
using System.Web.UI;
using System.Web.UI.Design;

namespace JQuery.WebKit
{
    public abstract class JMasterPage : MasterPage
    {
        [Category("Data"),
      UrlProperty("*.xml"),
      EditorAttribute(typeof(XmlDataFileEditor), typeof(UITypeEditor))]
        public string ContextXml
        {
            get;
            set;
        }

        public new JMasterPage Master
        {
            get { return base.Master as JMasterPage; }
        }

        public new JPage Page
        {
            get { return base.Page as JPage; }
        }

        public JUpdater Updater
        {
            get { return Page.Form.Updater; }
        }

        public new bool IsPostBack
        {
            get;
            private set;
        }

        public JForm Form
        {
            get { return Page.Form; }
        }

        //public ISecurityPrincipal Authentication
        //{
        //    get
        //    {
        //        return Page != null ? Page.Authentication : HttpContext.Current.Session["Authentication"] as ISecurityPrincipal;
        //    }
        //}

        public JMasterPage()
        {

        }
    }
}
